package com.cljz.makepassenger.ui.holder;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.cljz.makepassenger.base.App;
import com.cljz.makepassenger.R;
import com.cljz.makepassenger.model.net.bean.GetTypeListBean;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by apple on 2017/4/26.
 */

public class ModelAddHolder extends RecyclerView.ViewHolder {

    @BindView(R.id.tv_model)
    TextView tvModel;

    public ModelAddHolder(View itemView) {
        super(itemView);
        ButterKnife.bind(this, itemView);
    }

    public void setData(List<GetTypeListBean.DataBean> typeList, int position) {
        GetTypeListBean.DataBean data = typeList.get(position);
        tvModel.setText(data.getCate_name());
        if (data.getSelect()) {
            tvModel.setTextColor(App.getInstance().getResources().getColor(R.color.white));
            tvModel.setBackgroundColor(App.getInstance().getResources().getColor(R.color.title_right_text));
        } else {
            tvModel.setTextColor(App.getInstance().getResources().getColor(R.color.txt_black_color));
            tvModel.setBackgroundColor(App.getInstance().getResources().getColor(R.color.mine_bg));
        }
    }

}
